<?php session_start(); 
validaAcesso();
require_once"funcoes/bibl_tm.jsp";

if(isset($_GET[atualiza])==1){  setTm($_POST["pcodigo"],$_POST["pnome"]);}
if(isset($_GET[exc])==1){       delTm($_GET["pcodigo"]);}


if($_GET["cont"]==1){
     $resulta = getTm($_POST[ptm],"input");

     echo"
     <form method='POST' action='index.jsp?atualiza=1&alt=1' autocomplete='off'>
     <h2>Tipo de M&iacute;dia</h2>
     <input type='hidden' name='pcodigo' value='$resulta[0]'>
     <input type='text' size='20' maxlength='20' name='pnome' value='$resulta[1]'>
     <input type='submit' value='alterar'>
     <a class='excluir' href='index.jsp?exc=1&pcodigo=$resulta[0]&alt=1'>EXCLUIR</a>
     </form>
     ";

}else{
      echo"<form method='POST' action='index.jsp?alt=1&cont=1' autocomplete='off'>
      <h2>Tipo de M&iacute;dia</h2>
      <select name='ptm'>";
       getTm(0,"select");


      echo"</select><BR>
      <input type='submit' value='selecionar'>
      </form>";
}

?>



